package com.rran.study.designpattern.behavioral.observer.listener.simple;

import com.rran.study.designpattern.behavioral.observer.event.PlaceOrderEvent;
import com.rran.study.designpattern.behavioral.observer.model.OrderData;
import com.rran.study.designpattern.behavioral.observer.service.PlaceOrderObserver;

/**
 * @author yy
 * @Type PayObserver.java
 * @Desc
 * @date 2020/7/21 17:43
 */
public class PayObserver implements PlaceOrderObserver {
    @Override
    public void actionPlaceOrder(PlaceOrderEvent e) {
        this.payMoney(e.getOrderData());
    }

    /**
     * 支付
     */
    private void payMoney(OrderData orderData){
        System.out.println("支付成功"+orderData.getMoney()+"元");
    }

}
